package com.project.controller;

import com.project.bean.UserBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

/**
 * @Title: TestController
 * @Package: com.project.controller
 * @Description:
 * @Author: Liang-Xie
 * @Date: 2022/6/23 - 16:10
 */
@SuppressWarnings("all")
@Controller
public class TestController {
    @RequestMapping("test")
    public String test(HttpServletRequest req){
        req.setAttribute("name","刘永");
        req.setAttribute("age",20);

        List<UserBean> list=new ArrayList<>();
        list.add(new UserBean(1,"贝克汉姆","13511111111"));
        list.add(new UserBean(5,"迪丽热巴","13511115551"));
        list.add(new UserBean(2,"古丽娜抓","13511114441"));
        list.add(new UserBean(7,"马儿扎哈","13511113331"));
        list.add(new UserBean(3,"斯琴高娃","13511112221"));
        req.setAttribute("list",list);

        return "/showInfo.html";
    }
}
